home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
hc
/
timebill.sit
/
Job Summary
/
stack.txt
< prev
Wrap
Text File
|
1988-01-29
|
21KB
|
707 lines
-- stack: in
-- format: 8 (HyperCard 1)
-- flags: 0x0 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=0 h=0
-- scroll: x=0 y=0
-- background count: 2
-- first background id: 2627
-- card count: 3
-- first card id: 6568
-- list block id: 3862
-- print block id: 3509
-- font table block id: 0
-- style table block id: 0
-- free block count: 0
-- free size: 0 bytes
-- total size: 29088 bytes
-- stack block size: 16384 bytes
-- created by hypercard version: 0x00000000
-- compacted by hypercard version: 0x00000000
-- modified by hypercard version: 0x00000000
-- opened by hypercard version: 0x00000000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x0000220000002200
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0xCC003300CC003300
-- patterns[4]: 0xCC883322CC883322
-- patterns[5]: 0xEE88BB22EE88BB22
-- patterns[6]: 0xEECCBB33EECCBB33
-- patterns[7]: 0xFFCCFF33FFCCFF33
-- patterns[8]: 0xFFEEFFBBFFEEFFBB
-- patterns[9]: 0xFFFFFFBBFFFFFFBB
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x0
----- HyperTalk script -----
on newCard
put the date into field "sumDate"
end newCard
on startUp
play "choir" tempo 380 b3 c#4 d e f# g a#3 g4 f# e d c# d r f# r b r c# r b r a# r bw
show field "credits"
wait 3 secs
show field "credits2"
wait 4 secs
hide field "credits2"
wait 1 secs
hide field "credits"
end startUp
on openStack
hide message box
hide menuBar
hide tool window
hide pattern window
choose browse tool
set userLevel to 2
go last card of background 1
end openStack
on summarize
set the cursor to 4
put "yes" into sumTime
put "yes" into sumExp
put 1 into pg
put "no" into adjustSum
if the shiftKey is down then put "yes" into adjustSum
put the date into endDay
put "1/1/88" into startDay
if the optionKey is down then
ask "Start summary at what date?" with startDay
if it is empty then
beep
exit summarize
end if
put it into startDay
ask "End summary at what date?" with endDay
if it is empty then
beep
exit summarize
end if
put it into endDay
end if
put startDay into displayDate
put endDay into displayDate2
convert StartDay to secs
convert EndDay to secs
if adjustSum = "Yes" then
Answer "Summarize Time or Expense only?" with "Time" or "Expense" or "Cancel"
if it="cancel" then exit summarize
if it= "time" then
put "Yes" into SumTime
put "No" into sumExp
else
put "no" into sumTime
put "yes" into sumExp
end if
end if
show message box
put "SUMMARIZING"
push this card
get long id of this card
put it into Q
Put "" into field "person"
Put "" into field "week"
Put "" into field "activity"
Put "" into field "hours"
Put "" into field "total$"
Put "" into field "totalhours"
Put "" into field "summarytotal"
Put "" into field "desc."
put the date into field "sumdate"
if field "sumcode" is empty then
ask "Client code please?!"
put it into field "sumcode"
end if
put field "sumcode" into clientcode
set lockScreen to true
go card "rate scheme" --- get rate parameters
put field "expenseMark" into markUp
if hilite of background button "activity" is true then
put 2 into routine
end if
if hilite of background button "Person" is true then
if hilite of background button "Activity" is true then
put 3 into routine
else
put 1 into routine
end if
end if
if sumTime = "yes" then
if routine = 1 then ----by person
put field "PersonBase" into BaseRate
put field "P1" into person1
put field "P2" into person2
put field "P3" into person3
put field "P4" into person4
put field "P5" into person5
put field "P6" into person6
put field "P7" into person7
go stack "time sheet"
repeat with y=1 to the number of cards
go card y
put "Summarizing time from"&& displayDate && "to" && displayDate2 &&"Page" && pg
put field "weekendg" into compareDay
convert compareDay to secs
if compareDay < startDay or compareDay > endDay then next repeat
repeat with s= 1 to the number of lines of field "clientcode"
go card y
If clientcode is in line s of field "clientcode" then
put line s of field "description" into desc
put line s of field "hours" into hours
put field "weekendg" into putDate
put line s of field "activitycode" into activitycode
put field "name" into person
put 1 into PersonRate
if person is in person1 then
put second word of person1 into personRate
end if
if person is in person2 then
put second word of person2 into personRate
end if
if person is in person3 then
put second word of person3 into personRate
end if
if person is in person4 then
put second word of person4 into personRate
end if
if person is in person5 then
put second word of person5 into personRate
end if
if person is in person6 then
put second word of person6 into personRate
end if
if person is in person7 then
put second word of person7 into personRate
end if
put (hours * (personRate * baseRate)) into actualsum
push card
go stack "job summary"
go to q
put number of lines of field "person" into counter
add 1 to counter
if counter > 20 then
calculate
put field "totalhours" into HrTrans
put field "summarytotal" into sumTrans
put field "sumcode" into codeTrans
put "See nxt. pg." into field "summarytotal"
put "" into field "totalhours"
doMenu "new card"
get long id of this card
put it into q
add 1 to pg
put 1 into counter
put codeTrans into field "sumcode"
put hrTrans into field "totalhours"
put sumTrans into field "summarytotal"
end if
put person into line counter of field "Person"
put putDate into line counter of field "Week"
put activitycode into line counter of field "Activity"
put hours into line counter of field "Hours"
put desc into line counter of field "Desc."
set the numberFormat to "0.00"---dollars
put actualsum into line counter of field "total$"
set the numberFormat to "0"----normal
pop card
end if
end repeat
end repeat
go stack "job summary"
go to q
if sumExp = "no" then
if field "total$" is empty then
beep
answer "Something's screwy. Re-enter client code."
click at location of field "sumcode"
click at location of field "sumcode"
exit summarize
end if
end if
end if
if routine = 2 then ----- based on activity
put field "ac1" into billable1
put field "ac2" into billable2
put field "ac3" into billable3
put field "ac4" into billable4
put field "ac5" into billable5
put field "ac6" into billable6
put field "ac7" into billable7
put field "ac8" into billable8
put field "ac9" into billable9
put field "ac10" into billable10
put field "ac11" into billable11
put field "ac12" into billable12
go stack "time sheet"
repeat with y=1 to the number of cards
put "Summarizing time from"&& displayDate && "to" && displayDate2 &&"Page" && pg
go card y
put field "weekendg" into compareDay
convert compareDay to secs
if compareDay < startDay or compareDay > endDay then next repeat
repeat with s= 1 to the number of lines of field "clientcode"
go card y
If clientcode is in line s of field "clientcode" then
put line s of field "description" into desc
put line s of field "hours" into hours
put field "weekendg" into putDate
put field "name" into person
put line s of field "activitycode" into activitycode
if activitycode =1 then put billable1 into billable
if activitycode =2 then put billable2 into billable
if activitycode =3 then put billable3 into billable
if activitycode =4 then put billable4 into billable
if activitycode =5 then put billable5 into billable
if activitycode =6 then put billable6 into billable
if activitycode =7 then put billable7 into billable
if activitycode =8 then put billable8 into billable
if activitycode =9 then put billable9 into billable
if activitycode =10 then put billable10 into billable
if activitycode =11 then put billable11 into billable
if activitycode =12 then put billable12 into billable
if activitycode >12 then put 0 into billable
put (hours * billable) into actualsum
push card
go stack "job summary"
go to q
put number of lines of field "person" into counter
add 1 to counter
if counter > 20 then
calculate
put field "totalhours" into HrTrans
put field "summarytotal" into sumTrans
put field "sumcode" into codeTrans
put "See nxt. pg." into field "summarytotal"
put "" into field "totalhours"
doMenu "new card"
get long id of this card
put it into q
add 1 to pg
put 1 into counter
put codeTrans into field "sumcode"
put hrTrans into field "totalhours"
put sumTrans into field "summarytotal"
end if
put person into line counter of field "Person"
put putDate into line counter of field "Week"
put activitycode into line counter of field "Activity"
put hours into line counter of field "Hours"
put desc into line counter of field "Desc."
set the numberFormat to "0.00"---dollars
put actualsum into line counter of field "total$"
set the numberFormat to "0"----normal
pop card
end if
end repeat
end repeat
go stack "job summary"
go to q
if sumExp = "no" then
if field "total$" is empty then
beep
answer "Something's screwy. Re-enter client code."
click at location of field "sumcode"
click at location of field "sumcode"
exit summarize
end if
end if
end if
if routine=3 then --- by both activity and person
put field "ac1" into billable1
put field "ac2" into billable2
put field "ac3" into billable3
put field "ac4" into billable4
put field "ac5" into billable5
put field "ac6" into billable6
put field "ac7" into billable7
put field "ac8" into billable8
put field "ac9" into billable9
put field "ac10" into billable10
put field "ac11" into billable11
put field "ac12" into billable12
put field "PersonBase" into BaseRate
put field "P1" into person1
put field "P2" into person2
put field "P3" into person3
put field "P4" into person4
put field "P5" into person5
put field "P6" into person6
put field "P7" into person7
go stack "time sheet"
repeat with y=1 to the number of cards
put "Summarizing time from"&& displayDate && "to" && displayDate2 &&"Page" && pg
go card y
put field "weekendg" into compareDay
convert compareDay to secs
if compareDay < startDay or compareDay > endDay then next repeat
repeat with s= 1 to the number of lines of field "clientcode"
go card y
If clientcode is in line s of field "clientcode" then
put line s of field "description" into desc
put line s of field "hours" into hours
put field "weekendg" into putDate
put line s of field "activitycode" into activitycode
if activitycode =1 then put billable1 into billable
if activitycode =2 then put billable2 into billable
if activitycode =3 then put billable3 into billable
if activitycode =4 then put billable4 into billable
if activitycode =5 then put billable5 into billable
if activitycode =6 then put billable6 into billable
if activitycode =7 then put billable7 into billable
if activitycode =8 then put billable8 into billable
if activitycode =9 then put billable9 into billable
if activitycode =10 then put billable10 into billable
if activitycode =11 then put billable11 into billable
if activitycode =12 then put billable12 into billable
if activitycode >12 then put 0 into billable
put field "name" into person
put 1 into PersonRate
if person is in person1 then
put second word of person1 into personRate
end if
if person is in person2 then
put second word of person2 into personRate
end if
if person is in person3 then
put second word of person3 into personRate
end if
if person is in person4 then
put second word of person4 into personRate
end if
if person is in person5 then
put second word of person5 into personRate
end if
if person is in person6 then
put second word of person6 into personRate
end if
if person is in person7 then
put second word of person7 into personRate
end if
put (hours * (billable * personRate)) into actualsum
push card
go stack "job summary"
go to q
put number of lines of field "person" into counter
add 1 to counter
if counter > 20 then
calculate
put field "totalhours" into HrTrans
put field "summarytotal" into sumTrans
put field "sumcode" into codeTrans
put "See nxt. pg." into field "summarytotal"
put "" into field "totalhours"
doMenu "new card"
get long id of this card
put it into q
add 1 to pg
put 1 into counter
put codeTrans into field "sumcode"
put hrTrans into field "totalhours"
put sumTrans into field "summarytotal"
end if
put person into line counter of field "Person"
put putDate into line counter of field "Week"
put activitycode into line counter of field "Activity"
put hours into line counter of field "Hours"
put desc into line counter of field "Desc."
set the numberFormat to "0.00"---dollars
put actualsum into line counter of field "total$"
set the numberFormat to "0"----normal
pop card
end if
end repeat
end repeat
go stack "job summary"
go to q
if sumExp = "no" then
if field "total$" is empty then
beep
answer "Something's screwy. Re-enter client code."
click at location of field "sumcode"
click at location of field "sumcode"
exit summarize
end if
end if
end if
calculate
end if
if sumExp = "yes" then
go stack "Expenses"
repeat with y=1 to the number of cards
put "Summarizing expenses from"&& displayDate && "to" && displayDate2 &&"Page" && pg
go card y
put field "weekendg" into compareDay
convert compareDay to secs
if compareDay < startDay or compareDay > endDay then next repeat
repeat with s= 1 to the number of lines of field "clientcode"
go card y
If clientcode is in line s of field "clientcode" then
put "EXPENSE:" && line s of field "description" into desc
put line s of field "amount" into actualsum
put actualsum + (actualsum * (MarkUp * .01)) into actualsum
put field "weekendg" into putDate
put field "name" into person
put "X" into activitycode
put "X" into hours
push card
go stack "job summary"
go to q
put number of lines of field "person" into counter
add 1 to counter
if counter > 20 then
calculate
put field "totalhours" into HrTrans
put field "summarytotal" into sumTrans
put field "sumcode" into codeTrans
put "See nxt. pg." into field "summarytotal"
put "" into field "totalhours"
doMenu "new card"
get long id of this card
put it into q
add 1 to pg
put 1 into counter
put codeTrans into field "sumcode"
put hrTrans into field "totalhours"
put sumTrans into field "summarytotal"
end if
put person into line counter of field "Person"
put putDate into line counter of field "Week"
put activitycode into line counter of field "Activity"
put hours into line counter of field "Hours"
put desc into line counter of field "Desc."
set the numberFormat to "0.00"
add 0 to actualsum
put actualsum into line counter of field "total$"
set the numberFormat to "0"
if field "summarytotal" is empty then
put 0 into field "summarytotal"
end if
set the numberFormat to "0.00"
add actualsum to field "summarytotal"
set the numberFormat to "0"
pop card
end if
end repeat
end repeat
go stack "job summary"
go to q
if field "total$" is empty then
beep
answer "Something's screwy. Re-enter client code."
click at location of field "sumcode"
click at location of field "sumcode"
exit summarize
end if
end if
end summarize
on calculate
global sumExp
put 0 into total
put 0 into hours
Repeat with c=1 to the number of lines of field "Total$"
put line c of field "total$" into subtotal
add subtotal to total
put line c of field "hours" into subhours
if subhours = "x" then put 0 into subhours
add subhours to hours
end repeat
if field "summarytotal" is empty then
set the numberFormat to "0.0"
add 0 to hours
put hours into field "totalhours"
set the numberFormat to "0.00"
add 0 to total
put total into field "summarytotal"
set the numberFormat to "0"
else
add hours to field "totalhours"
set the numberFormat to "0.00"
add 0 to total
add total to field "summarytotal"
set the numberFormat to "0"
end if
end calculate